// pages/Vip/Vip.js
Page({
	data: {
		data: '',
		http: getApp().globalData.map,
		num:0, 
		text:'',
		uid:'',
		num1:'1'
	},

	index(e) {
		this.setData({
			num:e.detail.current
		})
		let a=this.data.data[e.detail.current].Describe.replace('end','\n')
		let b=a.replace('end','\n')
		this.setData({
			text: b,
			num1:e.detail.current+1
		})
		console.log(e.detail)
	},
	nav(){
		if(this.data.uid!=''){
			wx.navigateTo({
				url:'older/older?id='+this.data.data[this.data.num].ID
			})
		}else{
			wx.redirectTo({
				url:'../register/register'
			})
		}
	},
	/**
	 * 生命周期函数--监听页面显示
	 */
	onShow: function() {
		wx.showToast({
			title: '加载中',
			icon: 'loading'
		});
		wx.getStorage({
			key:'uid',
			success: (res) => {
				this.setData({
					uid:res.data
				})
			}
		})
		wx.request({
			url: getApp().globalData.http+"action=menbersCar",
			success: (res) => {
				console.log(res)
				wx.hideToast()
				console.log(res.data.data[0].ImgUrl)
				this.setData({
					data: res.data.data
				})
				let a=res.data.data[0].Describe.replace('end','\n')
				let b=a.replace('end','\n')
				console.log(b)
				this.setData({
					text: b
				})
			}
		})
	},

})
